package com.cyt.work.enrollment.model.po;

import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 自主招生-招生发布实体类
 *
 * @author caideyong
 * @date 2019-11-22 16:06:41
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_enrollment_release")
public class EnrollmentRelease implements Serializable {

	/**
     * 主键
     */ 
	@Id
	private String id;

	/**
     * 标题
     */ 
	@Column(name = "NAME")
	private String name;

	/**
     * 招生单位
     */ 
	@Column(name = "UNIT")
	private String unit;

	/**
     * 开始时间
     */ 
	@Column(name = "START_TIME")
	private Date startTime;

	/**
     * 结束时间
     */ 
	@Column(name = "END_TIME")
	private Date endTime;

	/**
     * 章程id
     */ 
	@Column(name = "RULE_ID")
	private String ruleId;

	/**
     * 章程详情
     */ 
	@Column(name = "RULE_DETAIL")
	private String ruleDetail;

	/**
     * 状态(编辑中，已发布，已结束)
     */ 
	@Column(name = "STATE")
	private String state;

	/**
     * 链接
     */ 
	@Column(name = "URL")
	private String url;

	/**
     * 二维码
     */ 
	@Column(name = "QR_CODE")
	private String qrCode;

	/**
     * 招收人数
     */ 
	@Column(name = "STU_NUM")
	private String stuNum;

	/**
     * 创建人
     */ 
	@Column(name = "CREATOR")
	private String creator;

	/**
     * 更新人
     */ 
	@Column(name = "UPDATOR")
	private String updator;

	/**
     * 创建时间
     */ 
	@Column(name = "CREATE_TIME")
	private Date createTime;

	/**
     * 更新时间
     */ 
	@Column(name = "UPDATE_TIME")
	private Date updateTime;

	/**
     * 删除标志
     */ 
	@Column(name = "REMOVE_TAG")
	private String removeTag;

	@Column(name="APPLY_ID")
	private String applyId;

	@Transient
	private String startTimeStr;
	@Transient
	private String endTimeStr;

	/**
	 * 创建对象
	 *
	 * @param sysUser 当前用户信息
	 * @author caideyong
	 * @date 2019-11-22 16:06:41
	 */
	public EnrollmentRelease(SysUser sysUser) {
		this.id = BaseUtil.uId();
		this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.creator = sysUser.getId();
		this.updateTime = new Date();
		this.updator = sysUser.getId();
	}
}